<?php
namespace app\webadmin\controller;
use think\Db;
use think\Request;

class Photo extends Base{

    public function index(Request $request){
        $topcate_id = $request->param('topcate_id');
        $cid = $request->param('cid');
        if(empty($topcate_id) || empty($cid)){
            return array('code'=>502,'msg'=>'参数错误');
        }
        $where = [
            'topcate_id'=>$topcate_id,
            'cid'=>$cid
        ];
        $lst = Db::name('table_photo')->where($where)->order('updatetime','desc')->paginate(10);
        $page = $lst->render();
        $this->assign(['lst'=>$lst,'page'=>$page]);
        return $this->fetch();
    }
	
	public function insertphoto(Request $request){
		if($request->isPost()){
			
		}
		return $this->fetch();
	}

}